$webwork.htmlEncode($page.space.name) : User Tutorial Shapefile
This page last changed on Aug 07, 2007 by cholmes.
IntroductionThis page will walk you through how to add a new data set to Geoserver. This is also available as a screencast There are two things you need to do to point Geoserver to a new data set. The first is to point to the new data (DataStore), the second is to set the meta information (FeatureType) describing the data.
STEP 1. Start GeoServer and LoginSTEP 1.1 Click on 'Start GeoServer' in your GeoServer folder (If you have not downloaded GeoServer, visit http://www.geoserver.org, click on the green "Download Now" button, and follow the directions). Direct your internet browser to the GeoServer start page by opening http://localhost:8080/geoserver in a new browser. STEP 1.2 Click 'Login'
Log yourself in with the username 'admin' and the password 'geoserver' STEP 2. Create a DataStoreNow we need to tell GeoServer what your data is and where you're storing it. STEP 2.1 Then, click on the 'DataStores' button. Finally, click on 'New' STEP 2.2 Select 'Shapefile' from the Feature Data Set Description drop-down menu. Then pick a name for your data set and enter it in the Feature Data Set ID box (I'll use "tutorial" as an example). Then click 'New'
STEP 2.3
Make sure all the other files associated with your shapefile (i.e. .dbf and .prj) are located in the same file (following the example above, all files would be located in the "mytutorial" folder). When you are done, hit the 'Submit' button. As of GeoServer 1.5.0, this will forward you to the FeatureType editor. If you need to get to the FeatureType page in the future you can navigate to it from the GeoServer homepage by going to Data -> FeatureTypes and selecting it from the drop down list. STEP 3. Create The FeatureTypeSTEP 3.1 This page allows you to customize how your data is presented on a map (text and polygon color, line thickness, etc.). Although there is a lot of information on this page, don't worry. You only need to pay attention to the 'Create New SLD,' 'Lookup SRS,' and 'Generate' buttons. Find the "Style:" field and click on 'Create New SLD' A new screen will appear that allows you to customize how your data will appear on a map. This page may differ slightly depending on what data you use. Just be sure to fill in all the required fields. Click the squares next to 'Text Color,' and 'Color of the lines' to select a color. Decide how wide, in pixels, you want your lines to be and enter that number in the 'Line dimensions' box. Click 'Apply Style' and then 'Finished'
STEP 3.2 Find the "SRS" box and click on 'Lookup SRS.' A set of numbers should appear in the box. If the phrase "UNKNOWN" appears, type in the SRS for your dataset, if you don' t know try '4326' (lat/long - a common SRS) in the box. Or add your own projection. Click 'Generate'
STEP 3.3 STEP 4. Try It OutSTEP 4.1 http://localhost:8080/geoserver/wms/kml_reflect?layers=example (using the Mini-Map preview screenshot above, my url would look like this: http://localhost:8080/geoserver/wms/kml_reflect?layers=tgr15001lkD) STEP 4.3 You can try out the WFS with this URL: You should get back a bunch of XML (GML), and it should look confusing, but you can probably make out the attributes of your file. TroubleshootingQ: Shapefiles - why do I have issues trying to do transactions against shapefiles?There are several issues that one can encounter when trying to do transactions against shapefiles. On windows NTFS sometimes locks the files, and if many users are operating against a featureType backed by shapefiles, there can be corruption issues. If one is to read the first lines of the Shapefile DataStore docs, one would find that we don't actually recommend using Shapefiles to do transactions against, since they were designed as a file transfer format, not as a transactional database backend. We provide transaction support for users to experiment with how a WFS-T works, but for any real production instance, we highly recommend using a real spatial database, such as PostGIS, DB2, Oracle Spatial, or ArcSDE. MySQL also has growing spatial support, but the spatial stuff is in the non-transactionally secure tables, so we don't yet recommend it for high user production environments.
user_shapefile_start.gif (image/gif)
user_shapefile_start_data.gif (image/gif) user_shapefile_start_stores.gif (image/gif) user_shapefile_ds_new.gif (image/gif) user_shapefile_ds_desc.gif (image/gif) user_shapefile_ds_desc.gif (image/gif) user_shapefile_ds_detail.gif (image/gif) apply_save.gif (image/gif) user_shapefile_ft_start.gif (image/gif) user_shapefile_ft_new.gif (image/gif) user_shapefile_ft_new_select.gif (image/gif) user_shapefile_ft_new_select.gif (image/gif) user_shapefile_ft_generate.gif (image/gif) user_shapefile_ft_submit.gif (image/gif) user_shapefile_ft_submit.gif (image/gif) Login.bmp (image/bmp) Login.gif.bmp (image/bmp) Login.JPG (image/jpeg) Login2.JPG (image/jpeg) Login2.JPG (image/jpeg) Login2.JPG (image/jpeg) Login1.JPG (image/jpeg) Config.jpg (image/jpeg) Data.jpg (image/jpeg) DataStores.jpg (image/jpeg) NewData.jpg (image/jpeg) NewDataFeature.jpg (image/jpeg) EditSource.jpg (image/jpeg) FeatureType.jpg (image/jpeg) CreateNewFeatureType.jpg (image/jpeg) PickSLD.jpg (image/jpeg) LookupGenerate.jpg (image/jpeg) Submit.jpg (image/jpeg) MiniMapPreview.jpg (image/jpeg) ApplySave.JPG (image/jpeg)
|
Document generated by Confluence on Jan 16, 2008 23:27 |